#include"Person.h"
#include"RealPerson.h"
RealPerson::RealPerson(const std::string& name,const Date& birthday,const Address& addr)
: theName(name),theBirthDate(birthday),theAddress(addr){}

std::shared_ptr<Person> Person::create(const std::string& name,const Date& birthday, const Address& addr){
    std::cout << "a RealPerson borned" << std::endl;
    return std::shared_ptr<Person>(new RealPerson(name,birthday,addr));
}

std::string RealPerson::name() const {
    return theName;
}

std::string RealPerson::birthDate() const{
    return theBirthDate.year + "/" + theBirthDate.month + "/" + theBirthDate.day ;
}

std::string RealPerson::address() const{
    return theAddress.province_ + "," + theAddress.city_ + "," + theAddress.area_;
}
